package org.journal.entity;

// Generated Dec 18, 2014 11:06:01 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Calendar;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * RecordEntity generated by hbm2java
 */
@Entity
@Table(name = "record", catalog = "journal")
public class RecordEntity implements java.io.Serializable {

	private Integer idRecord;
	private UserEntity userEntity;
	private String message;
	private Calendar date;

	public RecordEntity() {
	}

	public RecordEntity(UserEntity userEntity, Calendar date) {
		this.userEntity = userEntity;
		this.date = date;
	}

	public RecordEntity(UserEntity userEntity, String message, Calendar date) {
		this.userEntity = userEntity;
		this.message = message;
		this.date = date;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_record", unique = true, nullable = false)
	public Integer getIdRecord() {
		return this.idRecord;
	}

	public void setIdRecord(Integer idRecord) {
		this.idRecord = idRecord;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_user", nullable = false)
	public UserEntity getUserEntity() {
		return this.userEntity;
	}

	public void setUserEntity(UserEntity userEntity) {
		this.userEntity = userEntity;
	}

	@Column(name = "message")
	public String getMessage() {
		return this.message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", nullable = false, length = 19)
	public Calendar getDate() {
		return this.date;
	}

	public void setDate(Calendar date) {
		this.date = date;
	}

}
